package com.tuanzi.loan.web.lazy.family;

import org.springframework.data.domain.Page;

import com.tuanzi.loan.business.service.family.FirstPartyPrepaymentService;
import com.tuanzi.loan.core.lazy.BaseLazyDataModel;
import com.tuanzi.loan.core.util.SpringContextHolder;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.BusinessPrepaymentSearchRequest;
import com.tuanzi.loan.vo.response.family.BusinessPrepaymentSearchResponse;

/**
 * @author JinRuiyang 2017/11/21
 */
public class BusinessPrepaidDataModel extends BaseLazyDataModel<BusinessPrepaymentSearchRequest, BusinessPrepaymentSearchResponse> {

	private FirstPartyPrepaymentService firstPartyPrepaymentService = SpringContextHolder.getBean(FirstPartyPrepaymentService.class);

	public BusinessPrepaidDataModel(BusinessPrepaymentSearchRequest searchRequest) {
		super(searchRequest);
	}

	@Override
	protected Page<BusinessPrepaymentSearchResponse> doLoad(PageSearcher<BusinessPrepaymentSearchRequest> pageSearcher) {
		return firstPartyPrepaymentService.listBusinessPrepayment(pageSearcher);
	}
}